<?php
session_start();

function buildOptions($options, $selectedOption){
    foreach ($options as $value=>$text){
        if ($value==$selectedOption){
            echo '<option value='.$value.' selected="selected">'.$text.'</option>';
        }
        else{
            echo '<option value='.$value.'>'.$text.'</option>';
        }
    }
}

$genderOptions=array("0"=>"[Select]","1"=>"Male","2"=>"Female");
$monthOptions= array("0"=>"[Select]",
                     "1"=>"January",
                     "2"=>"February",
                    "3"=>"March",
                    "4"=>"April",
                    "5"=>"May",
                    "6"=>"June",
                    "7"=>"July",
                    "8"=>"August",
                    "9"=>"September",
                    "10"=>"October",
                    "11"=>"November",
                    "12"=>"December");
if (!isset ($_SESSION['value'])){
    $_SESSION['value']['txtUserName']='';
    $_SESSION['value']['txtName']='';
    $_SESSION['value']['selGender']='';
    $_SESSION['value']['selBthMonth']='';
    $_SESSION['value']['txtBthDay']='';
    $_SESSION['value']['txtBthYear']='';
    $_SESSION['value']['chkReadTerms']='';
}
if (!isset($_SESSION['errors']))
{
  $_SESSION['errors']['txtUsername'] = 'hidden';
  $_SESSION['errors']['txtName'] = 'hidden';
  $_SESSION['errors']['selGender'] = 'hidden';
  $_SESSION['errors']['selBthMonth'] = 'hidden';
  $_SESSION['errors']['txtBthDay'] = 'hidden';
  $_SESSION['errors']['txtBthYear'] = 'hidden';
  $_SESSION['errors']['txtEmail'] = 'hidden';
  $_SESSION['errors']['txtPhone'] = 'hidden';
  $_SESSION['errors']['chkReadTerms'] = 'hidden';
}


?>
